<template>
  <div>
    <NCard>
      <codemirror v-model="code" placeholder="Code goes here..." :style="{ width: '400px' }" :autofocus="true"
        :indent-with-tab="true" :tab-size="2" :extensions="extensions" @change="handleChange" />
      <RouterLink :to="{ name: 'first' }">back</RouterLink>
    </NCard>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { Codemirror } from "vue-codemirror";
import { javascript } from "@codemirror/lang-javascript";
// import { oneDark } from "@codemirror/theme-one-dark";
import { testApi } from "@/api";

const code = ref('');
const extensions = [javascript()];

const handleChange = (e: any) => {
  console.log(e);
};

testApi.testApi1().then((res: any) => {
  console.log(res);

})
</script>

<style scoped lang="less"></style>